<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet [
    <!ENTITY copy "&#169;">
    <!ENTITY nbsp "&#160;">
    <!ENTITY laquo "&#171;">
    <!ENTITY raquo "&#187;">
]>
<xsl:stylesheet xmlns="http://www.w3.org/1999/xhtml"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                version="1.0">


  <xsl:include href="../layout.xsl"/>  
  <xsl:include href="../msg.xsl"/>

  <xsl:template match="/">
    <xsl:apply-templates />
  </xsl:template>

  <xsl:template match="content">
    <xsl:apply-templates select="Main/form" />    
    
    <div class="content">
      <H2>
        <xsl:value-of select="Main/Title" />
      </H2>

      <div class="path">
        <a href="/{Main/Controller}/edit/id/{Main/Card/id}">
          <xsl:value-of select="Main/Card/name_ru"/>
        </a> /

        <a href="/{$Controller}/{Main/Controller}/id/{Main/Card/id}">
          Фотографии
        </a><br/>
      </div>      
   

      <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td width="100%" valign="top">
            <xsl:call-template name="sidebar">
              <xsl:with-param name="node" select="/page/content/Menu/menu2"></xsl:with-param>
            </xsl:call-template>

            <div>
              <xsl:choose>
                <xsl:when test="/page/content/Menu/menu2">
                  <xsl:attribute name="class">content2</xsl:attribute>
                </xsl:when>
                <xsl:otherwise>
                  <xsl:attribute name="class">content</xsl:attribute>
                </xsl:otherwise>
              </xsl:choose>
              <div id="poststuff">

                <ul id="tabs">
                  <li class='alignleft current' id='tab_1'>
                    <a href="javascript: change_tab(1);" class='tabs-link' onclick='javascript: change_tab(1);'>Русский</a>
                  </li>
                  <li class='alignleft' id='tab_2'>
                    <a href="javascript: change_tab(2);" class='tabs-link' onclick='javascript: change_tab(2);'>Украинский</a>
                  </li>
                  <li class='alignleft' id='tab_3'>
                    <a href="javascript: change_tab(3);" class='tabs-link' onclick='javascript: change_tab(3);'>Английский</a>
                  </li>
                </ul>

                <form action="" method="post" name="form" id="form" enctype="multipart/form-data">

                  <!-- Русский -->
                  <div id="page_1" style="display: block">
                    <fieldset>
                      <legend>Заголовок (Русский)</legend>
                      <div>
                        <input name="title_ru" type="text" id="title" value="{Main/form/title_ru}" size="70" class="broad100"/>
                      </div>
                    </fieldset>

                    <fieldset>
                      <legend>Описание</legend>
                      <div>
                        <textarea name="desc_ru" id="body" class="broad100">
                          <xsl:value-of select="Main/form/desc_ru"/>
                        </textarea>
                      </div>
                    </fieldset>
                  </div>

                  <!-- Украинский -->
                  <div id="page_2" style="display: none">
                    <fieldset>
                      <legend>Заголовок (Украинский)</legend>
                      <div>
                        <input name="title_ua" type="text" id="title" value="{Main/form/title_ua}" size="70" class="broad100"/>
                      </div>
                    </fieldset>

                    <fieldset>
                      <legend>Описание</legend>
                      <div>
                        <textarea name="desc_ua" id="body" class="broad100">
                          <xsl:value-of select="Main/form/desc_ua"/>
                        </textarea>
                      </div>
                    </fieldset>
                  </div>

                  <!-- Английский -->
                  <div id="page_3" style="display: none">
                    <fieldset>
                      <legend>Заголовок (Английский)</legend>
                      <div>
                        <input name="title_en" type="text" id="title" value="{Main/form/title_en}" size="70" class="broad100"/>
                      </div>
                    </fieldset>

                    <fieldset>
                      <legend>Описание</legend>
                      <div>
                        <textarea name="desc_en" id="body" class="broad100">
                          <xsl:value-of select="Main/form/desc_en"/>
                        </textarea>
                      </div>
                    </fieldset>
                  </div>

                  <fieldset>
                    <legend>
                      Аватар
                      <xsl:text> </xsl:text>                      
                        <a href="{$Files}{Main/form/path}avatar.jpg" target="_blank">Смотреть</a>                      
                    </legend>
                    <div>
                      <input name="avatar" type="file" id="avatar" size="30"/>
                    </div>
                  </fieldset>

                  <fieldset>
                    <legend>
                      Фото
                      <xsl:text> </xsl:text>                      
                        <a href="{$Files}{Main/form/path}{Main/form/file_name}" target="_blank">Смотреть</a>                      
                    </legend>
                    <div>
                      <input name="original" type="file" id="original" size="30"/>
                    </div>
                  </fieldset>                     


                  <p class="submit">                                        
                    <input name="save" type="submit" id="save" style="font-weight: bold;" value="Сохранить" />
                  </p>
                </form>
              </div>
            </div>
          </td>          
        </tr>
        <tr>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
        </tr>
      </table>
    </div>
  </xsl:template>  
  
</xsl:stylesheet>